/*
 * @Author: 许旺玉
 * @Description: 路由搭建和输出
 * @Date: 2020-06-22 15:04:51
 * @LastEditTime: 2020-07-02 17:14:49
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \靖凯商城\mobile_project\src\router\index.js
 */ 

import Vue from "vue"
import VueRouter from "vue-router"
import routes from "./routes"

Vue.use(VueRouter)

// 解决路由重复点击问题
const originalPush = VueRouter.prototype.push
   VueRouter.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}

export default new VueRouter({
    routes,
    scrollBehavior() {//滚动行为，回到顶部
        return { x: 0, y: 0 }
    }
})